/*
 * @Description:
 * @Author: baimenghan
 * @Email: baimenghan@nnuo.com
 * @Date: 2022-02-25 09:23:10
 * @LastEditors: baimenghan
 * @LastEditTime: 2022-02-25 14:19:25
 * @FilePath: \daka\src\App.jsx
 */
import "./App.css";
import "./App.sass";
// import logo from "@/logo.svg";
// import api from "./api";
import { Layout, Spin } from "antd";
import HeaderNav from "./components/HeaderNav/HeaderNav";
import FooterBanner from "./components/FooterBanner/FooterBanner";
import ConfigPage from "./views/ConfigPage/ConfigPage";
import HomePage from "./views/HomePage/HomePage";
import FormDialog from "./components/FormDialog/FormDialog";
import {
  BrowserRouter as Router,
  Route,
  Routes,
  Navigate,
} from "react-router-dom";

const { Content } = Layout;

function App() {
  // const {
  //   configApi: {
  //     getAllConfigApi,
  //     addconfigApi,
  //     deleteConfigApi,
  //     updateConfigApi,
  //     getAllApplicationApi,
  //   },
  //   infoApi: { getAllInfoApi, getDayInfoApi, checkIsSuccessApi },
  // } = api;

  return (
    <Layout className="app-layout">
      <Router>
        <HeaderNav />
        <Content className="layout-content">
          <Spin tip="Loading..." spinning={false}>
            <Routes>
              <Route path="/" element={<Navigate to="/home" />} />
              <Route path="/home" element={<HomePage />} />
              <Route path="/config" element={<ConfigPage />} />
            </Routes>
          </Spin>
        </Content>
        <FooterBanner />
        <FormDialog />
      </Router>
    </Layout>
  );
}

export default App;
